package com.hbnu.message;

import java.io.Serial;
import java.io.Serializable;

public class FileInfo implements Serializable {
    @Serial
    private static final long serialVersionUID = -4614313098892598549L;

    private boolean hasFile;
    private final long start;
    private int fileSize;
    private final String cPath;
    private final String sPath;



    public FileInfo(boolean hasFile, long start, int fileSize, String cPath, String sPath) {
        this.hasFile = hasFile;
        this.start = start;
        this.fileSize = fileSize;
        this.cPath = cPath;
        this.sPath = sPath;
    }


    public boolean hasRemaining(int length){
        fileSize-=length;
        return fileSize!=0;
    }

    public String getsPath() {
        return sPath;
    }


    public boolean isHasFile() {
        return hasFile;
    }

    public void setHasFile(boolean hasFile) {
        this.hasFile = hasFile;
    }

    public long getStart() {
        return start;
    }



    public long getFileSize() {
        return fileSize;
    }

    @Override
    public String toString() {
        return "FileInfo{" +
                "hasFile=" + hasFile +
                ", start=" + start +
                ", fileSize=" + fileSize +
                ", cPath='" + cPath + '\'' +
                ", sPath='" + sPath + '\'' +
                '}';
    }
}
